<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet" href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class='full-center-content-scroll-noheader'>
			<h:form id="form">
				<div class="box box-solid with-border">
					<div class="box-header">
						<p:outputLabel for="startTime" value="告警时间：" />
						<p:calendar id="startTime" navigator="true" value="#{protectionAlarmController.start}"
							pattern="yyyy-MM-dd" maxdate="Date()">
						</p:calendar>
						<p:outputLabel for="endTime" value="至 " style="margin-left:5px;margin-right:5px"/>
						<p:calendar id="endTime" navigator="true" value="#{protectionAlarmController.end}"
							pattern="yyyy-MM-dd" maxdate="Date()">
						</p:calendar>
						<p:commandButton value="查询" update="alarmTable" icon="ui-icon-search"
							actionListener="#{protectionAlarmController.query}" style="margin-left:5px;">
						</p:commandButton>
					</div>
				</div>
				<p:dataTable id="alarmTable" var="item"
					value="#{protectionAlarmController.model}" rowKey="#{item.bhId}"
					emptyMessage="无记录" rows="20" paginator="true" rowIndexVar="ite"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="20,50,100" paginatorPosition="bottom"  lazy="true">
					<f:facet name="{Customization}" >
						<p:outputLabel value="总计：#{protectionAlarmController.countRow} 条记录"
							style="margin-right:20px;"></p:outputLabel>
					</f:facet>
					<p:column width="20" headerText="序号">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column width="40" headerText="告警级别">
						<h:outputText value="#{item.level}" />
					</p:column>
					<p:column width="40" headerText="发生时间">
						<h:outputText value="#{item.triggerTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column width="40" headerText="恢复时间">
						<h:outputText value="#{item.recoveryTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column width="40" headerText="告警名称">
						<h:outputText value="#{item.name}" />
					</p:column>
					<p:column width="120" headerText="告警对象">
						<h:outputText value="#{item.alarmObject}" />
					</p:column>
					<p:column width="120" headerText="承载业务">
						<h:outputText value="#{item.alarmChannel}" />
					</p:column>
					<p:column width="40" headerText="变电站名称">
						<h:outputText value="#{item.stationName}" />
					</p:column>
					<p:column width="40" headerText="线路名称">
						<h:outputText value="#{item.bhLineName}" />
					</p:column>
					<p:column width="80" headerText="保护名称">
						<h:outputText value="#{item.bhName}" />
					</p:column>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/plugins/datatables/jquery.dataTables.js"></script>
		<script src="/resources/plugins/datatables/dataTables.bootstrap.min.js"></script>
		<script src="/resources/js/tables/mytable.js"></script>
	</ui:define>
</ui:composition>
